﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace GA.Server.ApiInfo
{
    [Serializable]
    public class ApiSkill
    {
        public string SkillGroup { get; private set; }
        public int SkillGroupId { get; private set; }
        public int SkillId { get; private set; }
        public string SkillName { get; private set; }

        public ApiSkill()
        {
        }

        public ApiSkill(XmlReader reader)
        {
            while (!reader.EOF)
            {
                reader.Read();
                if (reader.NodeType == XmlNodeType.Element)
                {
                    switch (reader.Name)
                    {
                        case "a:skill_group": SkillGroup = ApiXmlNode.GetValue(reader); break;
                        case "a:skill_group_id": SkillGroupId = int.Parse(ApiXmlNode.GetValue(reader)); break;
                        case "a:skill_id": SkillId = int.Parse(ApiXmlNode.GetValue(reader)); break;
                        case "a:skill_name": SkillName = ApiXmlNode.GetValue(reader); break;
                    }
                }
            }
        }
    }
}
